class BackStages::Show::AdminsController < ApplicationController
  def edit
    @valleyer = Valleyer.find params[:id]
  end

  def update
    @valleyer = Valleyer.find params[:id]
    if params[:old_password] == @valleyer.password
      @error = '&nbsp;与旧密码不符合'
    end
    render :edit unless @valleyer.update_attributes params[:valleyer]

    @all_articles = Article.all
    @articles = Article.paginate :page => params[:page_number], :per_page => 5, :order => "created_at desc"
  end

  def authorize

  end
end
